package com.niodata.dp.xls;

import java.util.List;

/**
 * csv or xls table definition.
 */
public class XlsSchema {

  private final List<XlsColumn> columns;

  public XlsSchema(List<XlsColumn> columns) {
    this.columns = columns;
  }

  public List<XlsColumn> getColumns() {
    return columns;
  }

  @Override
  public String toString() {
    StringBuffer sbu = new StringBuffer("Column Count:" + columns.size()).append("\r\n");
    for (XlsColumn column : columns) {
      sbu.append(column.getExampleValue());
      sbu.append("  ").append("(").append(column.getName()).append("   ").append(column.getType())
            .append(")\r\n");
    }
    return sbu.toString();
  }
}
